﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MoonLight.LibCommon;

namespace Autumn.Business
{
    class InfoCollector
    {
        public InfoCollector()
        {
            m_info = new Info();
        }

        public void SystemInfo()
        {
            Logger.WriteLog("run command systeminfo...");
            m_info.system_info = CmdPipe.StartCmd("systeminfo");
        }

        public void IpConfig()
        {
            Logger.WriteLog("run command ipconfig...");
            m_info.ipconfig = CmdPipe.StartCmdArgs("ipconfig", "/all");
        }

        public string GetInfoText()
        {
            string text = "";
            text += "============Ipconfig=============\n";
            text += m_info.ipconfig + "\n";
            text += "============SystemInfo===========\n";
            text += m_info.system_info + "\n";

            return text;
        }

        private Info m_info;
    }

    class Info
    {
        public Info()
        {
            system_info = "";
            ipconfig = "";
        }

        public string system_info;
        public string ipconfig;
    }
}
